package website;

import java.util.Vector;

import call4paper.CFP;
import call4paper.InterestArea;
import exceptions.DoesNotExistCFPException;
import exceptions.InvalidUserException;
import exceptions.ReviewerUserException;

public class AdminWebsite {
	
	
	private Vector<User> registeredUsers = new Vector<User>();
	private Vector<CFP> conferences = new Vector<CFP>();
	private ReviewerAsignation asignationMethod;

	public AdminWebsite() {}
	
	public AdminWebsite(ReviewerAsignation asignMethod) {
		this.asignationMethod = asignMethod;
	}

	public Vector<User> getRegisteredUsers() {
		return this.registeredUsers;
	}

	public boolean alreadyRegistered(User user) {
		return this.getRegisteredUsers().contains(user);
	}

	public boolean validateUpload(CFP testCfp, User registeredUser) throws ReviewerUserException {
		// TODO Auto-generated method stub
		return true;
	}

	public Vector<User> showPossibleReviewers(Vector<InterestArea> intAreas) {
		// TODO Auto-generated method stub
		return null;
	}

	public Vector<CFP> getCfpsCreated() {
		// TODO Auto-generated method stub
		return null;
	}

	public CFP searchCFP(String cfpName) throws DoesNotExistCFPException {
		
		CFP exists = null;
		
		for(CFP cfp: this.conferences) {
			if(cfp.getName().equals(cfpName))
				exists = cfp;
		}
		
		if(exists == null) {
			throw new DoesNotExistCFPException();
		} else { return exists; }
	}




}
